package com.music.service.urls.beans;

import java.sql.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.music.service.urls.constants.UrlAccessState;
import com.music.service.urls.constants.UrlState;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Url {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long urlId;
	
	@Persistent
	private Long songId;
	
	@Persistent
	private String urlPath;
	
	@Persistent
	private int state;
	
	@Persistent
	private UrlAccessState accessState;
	
	@Persistent
	private Long createdMemberId;
	
	@Persistent
	private Date creationDate;
	
	public Url(){
		state = UrlState.ACTIVE.getState(); //Default
	}
	/**
	 * @return the urlId
	 */
	public Long getUrlId() {
		return urlId;
	}
	/**
	 * @param pUrlId the urlId to set
	 */
	public void setUrlId(Long pUrlId) {
		urlId = pUrlId;
	}
	/**
	 * @return the songId
	 */
	public Long getSongId() {
		return songId;
	}
	/**
	 * @param pSongId the songId to set
	 */
	public void setSongId(Long pSongId) {
		songId = pSongId;
	}
	/**
	 * @return the urlPath
	 */
	public String getUrlPath() {
		return urlPath;
	}
	/**
	 * @param pUrlPath the urlPath to set
	 */
	public void setUrlPath(String pUrlPath) {
		urlPath = pUrlPath;
	}
	/**
	 * @return the state
	 */
	public UrlState getState() {
		return UrlState.getUrlState(state);
	}
	/**
	 * @param pState the state to set
	 */
	public void setState(UrlState pState) {
		state = pState.getState();
	}
	/**
	 * @return the accessState
	 */
	public UrlAccessState getAccessState() {
		return accessState;
	}
	/**
	 * @param pAccessState the accessState to set
	 */
	public void setAccessState(UrlAccessState pAccessState) {
		accessState = pAccessState;
	}
	/**
	 * @return the createdMemberId
	 */
	public Long getCreatedMemberId() {
		return createdMemberId;
	}
	/**
	 * @param pCreatedMemberId the ownerId to set
	 */
	public void setCreatedMemberId(Long pCreatedMemberId) {
		createdMemberId = pCreatedMemberId;
	}
	/**
	 * @return the creationDate
	 */
	public Date getCreationDate() {
		return creationDate;
	}
	/**
	 * @param pCreationDate the creationDate to set
	 */
	public void setCreationDate(Date pCreationDate) {
		creationDate = pCreationDate;
	}
	
	
}
